import java.util.Scanner;
import java.util.Stack;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 晓星航
 * Date: 2023-03-02
 * Time: 19:08
 */
public class TestDemo {
    public static void main(String[] args) {
        Stack<Integer> stack = new Stack<>();
        System.out.println(stack.isEmpty());
        stack.push(1);
        stack.push(2);
        stack.push(3);
        stack.push(4);
        stack.push(5);
        stack.push(16);
        stack.push(12);
        System.out.println(stack.pop());//弹出栈顶元素，并删除
        System.out.println(stack.peek());//获取栈顶元素，但是不删除
        System.out.println(stack.isEmpty());//判断栈中元素是否为空，为空返回true，不为空返回flase
        System.out.println(stack.size());//获取栈中元素个数，并返回数值
    }
    public static void main1(String[] args){
        Scanner scanner = new Scanner(System.in);
        while(scanner.hasNextLine()){
            for (int i = 1; i <= 100; i++) {
                String str = scanner.nextLine();
                if(str == "i"){
                    System.out.println("you are good!");
                }
            }
        }
    }
}
